// pages/user/suggest/suggest.js
import { areaList } from '../../../miniprogram_npm/@vant/area-data/data';
var http = require('../../../utils/http')
Page({

    /**
     * 页面的初始数据
     */
    data: {
        feedback:{
            position:'',
            content:''
        },
        content:'',
        areaList,
        show: false
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        console.log(this.data.areaList);
    },

    chooseposition(){
        this.setData({
            show:true
        })
    },
    confirm(e){
        this.setData({
            show:false,
            "feedback.position":e.detail.values[0].name + e.detail.values[1].name + e.detail.values[2].name
        })
    },
    cancel(e){
        this.setData({
            show:false
        })
    },
    submit(){
        this.setData({
            "feedback.content":this.data.content,
            "feedback.type":"course"
        })
        http.post("/feedback/addFeedBack",this.data.feedback,res=>{
            console.log(res);
        })
    }

})